// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import VueI18n from 'vue-i18n'
import App from './App'
import router from './router'
import environment from './common/environment'
import constants from './common/constants'

Vue.config.productionTip = false;
Vue.use(ElementUI);
Vue.use(VueI18n);

/**
 * Set local environment "MOCK" || "UAT" || "SIT" || "PRO"
 * "MOCK" : "http://localhost:8080"
 * "UAT" : "http://localhost:8080"
 * "SIT" : "https://xxx"
 * "PRO" : "https://xxx"
 */
environment.setEnvironment(constants.ENVS.MOCK);

const i18n = new VueI18n({
  locale: 'en',
  messages: {
    'zh': require('./i18n/zh'),
    'en': require('./i18n/en')
  }
});

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  i18n,
  components: { App },
  template: '<App/>'
});
